<!--#include file="inc/conn.asp" -->
<!--#include file="inc/Function.asp" -->
<!--#include file="inc/pageClass.asp"-->
<%
CheckAdmin
Dim txtSearch,  Rs, Sql, SearchType, SearchClass
txtSearch = Trim(checkstr(request("txtSearch")))
SearchType = Trim(request("SearchType"))
OrderList = Trim(request("OrderList"))


Select Case SearchType
    Case "1"
		If Left(txtSearch,2)="0x" Then sqlstr2="or user_ip_addr= "&txtSearch&""
        'sqlstr = sqlstr + "where character_name like '%"&txtSearch&"%' or oldname like '%"&txtSearch&"%'"
               sqlstr = sqlstr + "where character_name = '"&txtSearch&"' "&sqlstr2&""

    Case else
        'sqlstr = sqlstr + "where character_name = '"&txtSearch&"' or oldname = '"&txtSearch&"'"
				sqlstr = sqlstr + "where character_name like '%"&txtSearch&"%' or user_ip_addr like '%"&txtSearch&"%'"
	End Select



If txtSearch<>"" Then
sql="select * from user_character character_name "&sqlstr&" Order By wlevel desc"

Else
sql="select * from user_character  Order By wlevel desc"
End If
'response.write sql
  Set Rs = Server.CreateObject("ADODB.Recordset")
  Rs.Open sql,Conn_c,1,1
  Set page = New PageClass
    page.rs=Rs					'直接传递rs对象，传递成功后会自动关闭。如需要开启，请注释掉分页类的第87行val.Close。
    page.PageSize=Mypagesize					'分页大小
    page.setCount=-1					'可选。设置数据总数。0：使用RecordCount，-1：使用Count（默认），其他正数：指定的数据总数。字符串：获取数据总数的SQL。
    page.PageID="p"					'Request.QueryString中分页参数字符串



strtitle=ServerName&"-角色列表"


Call  head(strtitle)
If browser()="pc" Then Call  LeftMenu()

%>
  <!-- 右侧主体开始 -->
  <div class="page-content">
<%Call  mnav()%>	


		<div class="weadmin-body">
<%Call  Search()%>
                        <div class="layui-card-body layui-table-body layui-table-main" style="margin-top:-13px">
                            <table class="layui-table layui-form">
                                <thead>
                                  <tr>
                                    <th style="height:30px;">角色名字</th>
                                    <th style="width: 80px;">所属帐号</th>
									<%If browser()="pc" Then%>
                                    <th>等级</th>
                                    <th>游戏币</th>
                                    <th>职业</th>
                                    <th>最后上线时间</th>
                                    <th>地图</th>
									<th >旧名字</th>
									<%End If%>
									 <th>IP地址</th>
									</tr>
                                </thead>
                                <tbody>
								  <%
								  If page.eof Or page.bof Then 
								 response.write "<TR><th align=left colSpan=8 height=30>没有找到任何记录...</th></TR>"
								 Else
								 Do While Not page.EOF
SET RSU = Conn.Execute("SELECT user_no,user_id,login_flag,vip  FROM user_profile WHERE user_no = '"&page("user_no")&"'")
If RSU.eof Then 
	user_id="错误帐号"
	character_name=page("character_name")
else
			if rsu("vip")=1  then
				user_id="<font color=""#FF0000"">"&RSU("user_id")&"</font>"
			else
				user_id=RSU("user_id")
			End If 

			if rsu("login_flag")=20  then
				character_name="<font color=""#FF0000"">"&page("character_name")&"</font>"
			else
				character_name=page("character_name")
			End If 
vip=rsu("vip")
End If 
rsu.close
Set rsu=Nothing
								 %>
                                  <tr >
                                    <th style="height:25px;" title="<%=page("character_no")%>"><a  href="Char_Edit.asp?character_no=<%=page("character_no")%>"><%=page("character_name")%></A></th>
                                    <th><a href="User_Edit.asp?user_no=<%=page("user_no")%>"><%=user_id%></a></th>
									<%If browser()="pc" Then%>
                                    <th><%=page("wLevel")%></th>
                                    <th><%=page("dwmoney")%></th>
									<th><%=GetClass(page("bypcclass"))%></th>
									<th><%if page("login_time")<>"" then response.write page("login_time")%></th>
									<th><%=MapName(page("wMapIndex"))%><%=page("wMapIndex")%></th>
									<th><%=page("oldname")%></th>
									<%End If %>
									<th>
									<a href="Char_List.asp?txtSearch=0x<%=ShowHex(page("user_ip_addr"))%>&SearchType=1"><%if not isnull(page("user_ip_addr")) then response.write cip(Int(Hexnumber(ShowHex(page("user_ip_addr")))))%></a>
									
									</th>
                                  </tr>
                                                                
<%
   page.MoveNext
	Loop
	End If 
		 %>
                                </tbody>
                           </table>						   
                        </div>	
						<div class="page">
								<%
								If browser()="pc" Then
									Response.write page.Control(10,"{Ctrl} {State}")
								Else
									Response.write page.Control(5,"{Ctrl} {State}")
								End If
								%> / 执行时间 <%=Int(FormatNumber((Timer() - TimerStart) * 1000, 3))%> ms
                        </div>

		</div>
  </div>
	<%Call  footer%>
</body>
</html>